<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>爱上电视C1系统</title>
	<link rel="stylesheet" href="css/c1.css">
	<script src="js/jquery.js"></script>
	<script src="js/layer/layer.js"></script>
	<script src="js/c1.js"></script>
	<script type="text/javascript">
	$(function(){
		var operationVal = 0,
			dataJson = {}; 
		$("#operation").change(function(){
			operationVal = $(this).val();
			if(operationVal ==0 ){
				$(".delFile").show();
			}else if(operationVal ==1){
				$(".delFile").hide();
			}
		});
		$('#delete').on('click', function(){ 
			var group = $("#group").val();
		     layer.msg('模板确认下发吗？',{
		    	 time:0,
		    	 btn:['确认','取消'],
		    	 yes:function(index){
		    		 layer.close(index);
		    		 if(operationVal==0){
		    			 var filetoDelete = $("#filetoDelete").val(),
		    			 	fileDestpath = $("#fileDestpath").val(),
		    			 	platform = $("#platform").val();
		    			 dataJson = {
		    				operationVal:operationVal,
		    				filetoDelete:filetoDelete,
		    				fileDestpath:fileDestpath,
		    				platform:platform,
		    				group:group
		    			 };
		    		 }else if(operationVal ==1){
		    			 var fileDestpath = $("#fileDestpath").val(),
		    			 	platform = $("#platform").val();
		    			 dataJson = {
		    					 	operationVal:operationVal,
				    				fileDestpath:fileDestpath,
				    				platform:platform,
				    				group:group
				    			 };
		    		 }
		    			$.ajax({
		    				url:'/GSConeClient/DeleteServlet',
		    				data:dataJson,
		    				type:'get',
		    				success:function(data){
		    					alert("下发成功");
		    		
		    				},
		    				error:function(){
		    					alert("下发失败");
		    				}
		    			});
		    		
		    	 }
		     })
		});
	})
	
	</script>
</head>
<body>
	<div class="header">
		<div class="header_one">
			<p>欢迎您：您当前所在的位置：爱上电视C1系统</p>
		</div>
		<div class="header_two">
			<ul id="tabs_one">
				<li class="tab-nav l"><a href="update.jsp">模板下发</a></li>
				<li class="tab-nav-action l"><a href="delete.jsp">文件删除</a></li>
				<li class="tab-nav l"><a href="record.jsp?page=1">日志</a></li>
				<li class="tab-nav r">
				<a href="${pageContext.request.contextPath}/LogoutServlet"><span ><img src="img/loginout.jpg" alt="loginout"
				class="login-out">退出</span></a></li>
				<li class="tab-nav r" style = "${sessionScope.user.username=='adminstrator'?'':'visibility:hidden'} ;">
				<a href="${pageContext.request.contextPath}/editPassword.jsp"><span><img src="img/modify.jpg" alt="modify"  class="modify-message">修改密码</span></a>
				</li>
			</ul>
		</div>
	</div>
	<div class="main">
		<div class="main_one">
			<p>爱上电视C1系统</p>
		</div>
		<div class="main_two">
			<img src="img/banner.png" alt="bannerPic">
		</div>
		<div class="main_three">
			<p class="module_update"><span class="module_icon">文件删除</span></p>
			<div class="main_three_data">
				<div class="data_show">
					<label for="operation">删除操作：</label>
					<select name="operation" id="operation" class="operation">
						<option value="0" selected="selected">删除文件</option>
						<option value="1">删除文件夹</option>
					<select>
				</div>
				<div class="data_show delFile">
					<label for="filetoDelete">文件名字：</label>
					<input type="text" name="filetoDelete" id="filetoDelete"/>
				</div>
				<div class="data_show delFilePath">
					<label for=fileDestpath">所在路径：</label>
					<input type="text" name="fileDestpath" id="fileDestpath"/>
				</div>
				<div class="data_show">
					<label for=groupLable">分组名：</label>
					<input type="text" name="group" id="group"/>
				</div>
				<div class="data_show">
					<label for="platform">选择平台：</label>
					<select name="platform" id="platform">
						<option value="zte" selected="selected">中兴</option>
						<option value="hua">华为</option>
					<select>
				</div>
				<div class="data_submit">
					<button id="delete" value="fileupdate">确认删除</button>
				</div>
			</div>
		</div>
	</div>
	<div class="footer">
		<p>Copyrighto 2015,China IPTV Co.,Ltd.ALLRights Reserved</p>
	</div>
</body>
</html>